﻿Imports Infragistics.Win.UltraWinGrid
Imports Crystal.CLL

Public Module mdlDataHubViewCommon
    'Public mstrSOFColPrefix As String = "~"
    'Public mstrSourceDateColSuffix As String = " Date"
    'Public mstrFormulaColSuffix As String = " Formula"


    'Public Function CheckInvalidValue(ByVal lUltraRow As UltraGridRow, ByVal pblnIsFromColumnList As Boolean, ByVal grdData As UltraGrid, ByVal mdtCurrentDataSources As DataTable, ByVal marrPreviousProjects() As String) As Boolean
    '    Dim lintColCounter As Integer = 0
    '    Dim lblnIsSOFExists As Boolean = False
    '    Dim lblnIsFormulaExists As Boolean = False
    '    Dim lblnIsManual As Boolean = False
    '    Dim lblnCanAccessDelete As Boolean = True
    '    Dim lblnLoopStatus As Boolean = True
    '    Dim lultraIterativeRow As UltraGridRow = Nothing

    '    While lblnLoopStatus
    '        For Each lRow As UltraGridRow In grdData.Rows
    '            If pblnIsFromColumnList Then
    '                lultraIterativeRow = lRow
    '            Else
    '                lultraIterativeRow = lUltraRow
    '            End If
    '            While lintColCounter < mdtCurrentDataSources.Rows.Count
    '                If pblnIsFromColumnList Then
    '                    If mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.RGT.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.REG.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.BKL.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.EBL.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.PRB.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.EPB.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.RSH.ToString AndAlso _
    '                        mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode") <> SourceTypeCode.PBC.ToString Then
    '                        lintColCounter += 1
    '                        Continue While
    '                    End If
    '                End If
    '                If lultraIterativeRow.Cells(mdtCurrentDataSources.Rows(lintColCounter).Item("SourceName")).Value.ToString.Equals("0") Then
    '                    If grdData.Rows.Band.Columns.Exists(mstrSOFColPrefix + mdtCurrentDataSources.Rows(lintColCounter).Item("SourceName")) Then
    '                        lblnIsSOFExists = True
    '                    ElseIf grdData.Rows.Band.Columns.Exists(mdtCurrentDataSources.Rows(lintColCounter).Item("SourceName") + mstrFormulaColSuffix) Then
    '                        lblnIsFormulaExists = True
    '                    End If

    '                    If lblnIsSOFExists Then
    '                        If lultraIterativeRow.Cells(mstrSOFColPrefix + mdtCurrentDataSources.Rows(lintColCounter).Item("SourceName")).Value.ToString.Equals("1") = False Then
    '                            lblnIsManual = True
    '                        End If
    '                    End If

    '                    If lblnIsManual = False AndAlso lblnIsFormulaExists = True Then
    '                        If lultraIterativeRow.Cells(mdtCurrentDataSources.Rows(lintColCounter).Item("SourceName") + mstrFormulaColSuffix).Value.ToString.Equals("") = False Then
    '                            lblnIsManual = True
    '                        End If
    '                    End If

    '                    If lblnIsManual Then
    '                        If mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode").Equals("UPD") OrElse _
    '                            mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode").Equals("DDQ") OrElse _
    '                            mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode").Equals("RSH") OrElse _
    '                            mdtCurrentDataSources.Rows(lintColCounter).Item("SourceTypeCode").Equals("PBC") Then
    '                            lblnCanAccessDelete = False
    '                            Return False
    '                        End If
    '                    End If
    '                ElseIf lultraIterativeRow.Cells(mdtCurrentDataSources.Rows(lintColCounter).Item("SourceName")).Value.ToString.Equals("") = False Then
    '                    lblnCanAccessDelete = False
    '                    Return False
    '                End If
    '                lintColCounter += 1
    '            End While
    '            If pblnIsFromColumnList = False Then
    '                lblnLoopStatus = False
    '                Exit For
    '            End If
    '        Next
    '        lblnLoopStatus = False
    '    End While

    '    If pblnIsFromColumnList = False Then
    '        lintColCounter = 0
    '        While lintColCounter < marrPreviousProjects.Length
    '            If lUltraRow.Cells(marrPreviousProjects(lintColCounter)).Value.ToString.Equals("") = False AndAlso lUltraRow.Cells(marrPreviousProjects(lintColCounter)).Value.ToString.Equals("0") = False Then
    '                lblnCanAccessDelete = False
    '                Return False
    '            End If
    '            lintColCounter += 1
    '        End While
    '    End If
    '    Return True
    'End Function


End Module
